home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 251_01 / list3.ps < prev    next >
Text File  |  1987-10-27  |  896b  |  30 lines

  1. %!
  2. % Produce Figure 4
  3. /inch {72 mul} def
  4. /width 4.54 inch def
  5. 50 400 translate
  6. width width scale % make square image of desired width
  7. /printerresolution
  8.   72 0 matrix defaultmatrix dtransform dup mul exch dup mul add sqrt
  9. def
  10. /screen printerresolution 16 div def
  11. screen 127 gt {/screen 127 def} if
  12. screen currentscreen 3 -1 roll pop setscreen
  13. /n width screen mul 72 div 2 sqrt mul 0.99 add cvi def % number of cells
  14. across image
  15. /nx n 2 mul def
  16. /ny n 2 idiv def
  17. /fbase 0.5 n mul 1.0 nx div exp def
  18. /fa 360  nx div fbase ln div def
  19. /c 1 def
  20. /cbase 0.003 1.0 ny div exp def
  21. /S nx string def
  22.  
  23. nx ny 8 [nx 0 0 ny 0 0]
  24. {/c c cbase mul def /f fa def
  25.   0 1 nx 1 sub{S exch f sin c mul 1.0 add 126.5 mul cvi put /f f fbase mul
  26. def}for
  27.   S}
  28. image
  29.  
  30. showpage